com.supermap.services
Class ServiceBase
- java.lang.Object
-
- com.supermap.services.ServiceBase
-
- Direct Known Subclasses:
- DataDownloadService, DataUploadService, QueryService
public abstract class ServiceBase extends java.lang.Object
This class is the service base class of iServer.It is the base class of the request service. All service classes which integrate with iServer inherit from this class, such as the query service, data uploading, and data downloading.
The request of this class to service is asynchronous. If users want to get the request result, they should register the response callback, that is, set response callback by setResponseCallback.
Users need to rewrite ResponseCallback, get FeatureSet from receiveResponse, also get the operation result and network exceptions, etc.
-
-
Constructor Summary
Constructors Constructor and Description ServiceBase(java.lang.String url)
Constructs a service base class with the url parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ResponseCallback
getResponseCallback()
Gets the response callback.java.lang.String
getUrl()
Gets the url corresponding to the service.java.lang.String
getUrl()
Get the Url corresponding to the service.boolean
setResponseCallback(ResponseCallback responseCallback)
Sets the response callback.void
setServerName(java.lang.String serverName)
Sets the service name, such as: "iserver" in "http:192.168.120.1:8090/iserver/services/void
setToken(java.lang.String token)
Query service support setup tokenvoid
setUrl(java.lang.String url)
Sets the url of the service.
-
-
-
Constructor Detail
-
ServiceBase
public ServiceBase(java.lang.String url)
Constructs a service base class with the url parameter.- Parameters:
url
- specified url. url means the service address published by iServer/iPortal, such as : http://192.168.120.1:8090/iserver?http://192.168.120.1:8090/iportal Note: It starts to support iServer services of iPortal from SuperMap iMobile 8C for Android version
-
-
Method Detail
-
setUrl
public void setUrl(java.lang.String url)
Sets the url of the service.- Parameters:
url
- set url. url means the service address published by iServer/iPortal, such as : http://192.168.120.1:8090/iserver?http://192.168.120.1:8090/iportal Note: It starts to support iServer services of iPortal from SuperMap iMobile 8C for Android version
-
getUrl
public java.lang.String getUrl()
Gets the url corresponding to the service.- Returns:
- The Url corresponding to the service.
-
setResponseCallback
public boolean setResponseCallback(ResponseCallback responseCallback)
Sets the response callback.- Parameters:
responseCallback
- response Callback- Returns:
- A boolean. Return true if successful; otherwise, false.
-
getResponseCallback
public ResponseCallback getResponseCallback()
Gets the response callback.- Returns:
- The response callback.
-
setServerName
public void setServerName(java.lang.String serverName)
Sets the service name, such as: "iserver" in "http:192.168.120.1:8090/iserver/services/..."; "iserver" is the default value. If it is changed, it is needed to set it by the interface, otherwise the url will occur errors- Parameters:
serverName
- server name
-
getToken
public java.lang.String getToken()
Enquiry service support to obtain token- Return:
- token
-
setToken
public void setToken(java.lang.String token)
Query service support setup token
-
-